<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
    <body>

        This text above will not be displayed.

        <ui:composition template="/templateAluno.xhtml">

            This text will not be displayed.

            <ui:define name="title">
                index
            </ui:define>

            <ui:define name="content">

                <h2><h:outputText value="Cursos:"/></h2>

                <h3>
                    <h:form>

                        <h:panelGroup rendered="#{cursoMB.listaDataModel == null || cursoMB.listaDataModel.rowCount == 0}" >

                            <h:outputText value="Nenhum curso encontrado!" />
                            <br/>

                        </h:panelGroup>

                        <h:dataTable value="#{cursoMB.listaDataModel}" var="curso" border="1" bgcolor="gray" style="width: 100%; text-align: center"
                                     rendered="#{cursoMB.listaDataModel != null and cursoMB.listaDataModel.rowCount != 0}" >

                            <h:column>
                                <f:facet name="header">
                                    <h:outputLabel value="Id"/>
                                </f:facet>
                                <h:outputText value="#{curso.id}"/>
                            </h:column>

                            <h:column>
                                <f:facet name="header">
                                    <h:outputLabel value="Nome"/>
                                </f:facet>
                                <h:outputText value="#{curso.nome}"/>
                            </h:column>

                            <h:column>
                                <f:facet name="header">
                                    <h:outputLabel value="Codigo"/>
                                </f:facet>
                                <h:outputText value="#{curso.codigo}"/>
                            </h:column>

                            <h:column>
                                <h:commandButton value="Exibir Disciplinas" action="#{cursoMB.exibirDiscPelaExibirTodos}"/>
                            </h:column>

                        </h:dataTable>

                        <br/>
                        <h:commandButton value="Voltar" action="#{cursoMB.voltarAluno}" immediate="true"/>

                    </h:form>
                </h3>

            </ui:define>

            This text will not be displayed.

        </ui:composition>

        This text below will also not be displayed.

    </body>
</html>

